<?php
$data=[
	['name'=>'lisi','age'=>12],
	['name'=>'xiaoming','age'=>23],
];
// $str="{name:'lisi','age':99}";
?>

<script>
	var data =<?php echo json_encode($data);?>;
	alert(data[1].name);
</script>